package com.lvlian.ge_message.model

class ContactInfo(val text:String) {

    val phoneNumber by lazy {
        text.split(" ")[0]
    }

    fun formatMsg(message: String, replace: String): String {
        var str: String = message
        val contactArray = text.split(" ")
        val replaceArray = replace.split(" ")
        var i = 1
        for (word in replaceArray) {
            str = str.replace(word, contactArray[i++])
        }
        return str
    }

}